This paper proposes a novel energy hub model for areas using both heat and cold demands that arise due to the major changesin environmental temperature in different periods of the year. The energy demand and the electrical price in a competitiveelectricity market are uncertain with stochastic values which are usually performed by a probability distribution function. Therefore, a stochastic mathematical model representing an Optimal operation of energy hub is based on the objective functionof minimization of energy costs (including electricity and gas). Several constraints such as energy balance, limited capacityof the transformer, air conditioners, gas boilers, absorption chillers, combined heat, and power and battery energy storagesystem are also incorporated into the model to guarantee the required specifications. The high-level algebraic modelingsoftware, general algebraic modeling system has been employed to undertake calculations. Finally, numerical results haveillustrated the efficiency and capability of the proposed models.